package com.office.meeting.service.impl;

import com.office.common.utils.SecurityUtils;
import com.office.meeting.domain.MeetingReport;
import com.office.meeting.mapper.MeetingUserMapper;
import com.office.meeting.service.MeetingUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: 柒月
 * @date: 2025/6/27 下午4:12
 * @version: 1.0
 */
@Service
public class MeetingUserServiceImpl implements MeetingUserService {

    @Resource
    private MeetingUserMapper meetingUserMapper;


    /**
     * @return 获取本月会议数
     */
    @Override
    public Long getMeetingMonthlyCount() {
        // 获取当前登录用户的id
        Long loginUserId = SecurityUtils.getUserId();
        return meetingUserMapper.selectMonthlyCount(loginUserId);
    }

    /**
     * @return 本月参加的人数
     */
    @Override
    public Long getMeetingPepopleCount() {
        // 获取当前登录用户
        Long loginUserId = SecurityUtils.getUserId();
        return meetingUserMapper.selectPepopleCount(loginUserId);
    }

    /**
     * @return 分页后的最近的会议信息
     */
    @Override
    public List<MeetingReport> getAllMeetingInfo() {
        // 获取当前登录用户
        Long loginUserId = SecurityUtils.getUserId();
        return meetingUserMapper.selectAllMeetingInfo(loginUserId);
    }

    /**
     * @return 我参与的会议的信息
     */
    @Override
    public List<MeetingReport> getParticipateMeeting() {
        long loginUserId = SecurityUtils.getUserId();
        return meetingUserMapper.selectParticipateMeeting(loginUserId);
    }
}
